;Rob's multitasking assembler shell application
;Copyright  1997 Kiwi Software Systems
;Use freely!  (If your sensible, you won't)

MOV	R0,#200
LDR	R1,taskstring
ADR	R2,description
SWI	"Wimp_Initialise"
STR	R1,taskhandle
.poll_loop
 MOV	R0,#0
 ADR	R1,b
 SWI	"Wimp_Poll"
 
 CMP	R0,#17
 BL	message
 CMP	R0,#18
 BL	message
B poll_loop

.message
 ADR R0,b
 LDR R0,[R0,#16]
 
 CMP R0,#0		;quit message
 BEQ close

MOV PC,R14
 
.close
 LDR	R0,taskhandle
 LDR	R1,taskstring
 SWI	"Wimp_CloseDown"
 SWI	"OS_Exit"

.taskhandle
EQUD 0

.taskstring
EQUS "TASK"

.description
EQUS "Shell"+CHR$0

;Block passed to wimp for it to store stuff in
.b
EQUS STRING$(255,CHR$0)
